package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;

/**
 * 物料库存流水对象 material_inventory_flow
 *
 * @author ruoyi
 * @date 2025-07-23
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(resultMap = "com.ruoyi.factorydata.mapper.MaterialInventoryFlowMapper.MaterialInventoryFlowResult")
public class MaterialInventoryFlow extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 库存流水id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 单据编号
     */
    @Excel(name = "单据编号")
    private String documentNumber;

    /**
     * 流水类型：in-入库 out-出库
     */
    @Excel(name = "流水类型")
    private String flowType;

    /**
     * 单据类型：purchase-采购入库
     */
    @Excel(name = "单据类型")
    private String documentType;
    /**
     * 仓库id
     */
    @Excel(name = "仓库id")
    private Long warehouseId;

    /**
     * 仓库编码
     */
    @Excel(name = "仓库编码")
    private String warehouseCode;

    /**
     * 库位id
     */
    @Excel(name = "库位id")
    private Long warehousePositionId;

    /**
     * 库位编码
     */
    @Excel(name = "库位编码")
    private String warehousePositionCode;
    /**
     * 物料id
     */
    @Excel(name = "物料id")
    private Long materialId;
    /**
     * 物料编码
     */
    @Excel(name = "物料编码")
    private String materialCode;

    /**
     * 物料名称
     */
    @Excel(name = "物料名称")
    private String materialName;

    /**
     * 物料分类
     */
    @Excel(name = "物料分类")
    private Long materialCategory;

    /**
     * 物料类型
     */
    @Excel(name = "物料类型")
    private String materialType;

    /**
     * 计量单位
     */
    @Excel(name = "计量单位")
    private Long materialUnit;

    /**
     * 数量
     */
    @Excel(name = "数量")
    private Long quantity;

    /**
     * 批次
     */
    @Excel(name = "批次")
    private String batchNumber;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;

    /**
     * 计量单位
     */
    @Excel(name = "计量单位")
    @TableField(exist = false)
    private String materialUnitName;

    /**
     * 物料分类
     */
    @Excel(name = "物料分类")
    @TableField(exist = false)
    private String materialCategoryName;

    /**
     * 仓库名称
     */
    @Excel(name = "仓库名称")
    @TableField(exist = false)
    private String warehouseName;

    /**
     * 库位名称
     */
    @Excel(name = "库位名称")
    @TableField(exist = false)
    private String warehousePositionName;

    /**
     * 单据Id
     */
    @Excel(name = "单据Id")
    private String documentId;
}